﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace PlantsVsZombies
{
    public class SunFlower : NormalPlant
    {
        public SunFlower()
        {
            
        }
        public SunFlower(ContentManager content, Vector2 size)
        {

            Cost = 50;
            RechargeTime = 0.0f;
            Blood = 10f;
            TimeForSun = 2f;
            Size = this.Size;
            Sprite temp = new Sprite(content,@"Image\Plant\SunFlower",new Vector2(0,0),Vector2.Zero );

            Sun = MyContent.LoadSunSmall();
            Sun.Visible = false;

            NSprites = 1;
            Sprites = new List<Sprite>();

            if (Math.Abs(Size.X - 0) > 0.01f)
                Size = Size;
            else
            {
                Size = temp.Size;
            }
            temp.Visible = false;
            Sprites.Add(temp);
        }

        

      

        public override Plant Clone()
        {

            NormalPlant plant = new SunFlower();
            plant.Cost = this.Cost;
            plant.RechargeTime = this.RechargeTime;
            plant.Blood = this.Blood;
            plant.Size = this.Size;
            plant.TimeForSun = this.TimeForSun;

            plant.NSprites = this.NSprites;
            plant.Sprites = new List<Sprite>();
            for(int i=0; i<Sprites.Count; i++)
                plant.Sprites.Add(Sprites[i]);

            plant.Sun = MyContent.LoadSunSmall();
            plant.Sun.Visible = false;
            return(Plant) plant;
        }





    }
}
